package com.lwx.web.lesson2;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;

/**
 * @author draem
 * @create 2018-06-28 14:48
 */
@RestController
public class ThymeleafController {

    @RequestMapping("/getThymeleaf")
    public ModelAndView getThymeleaf(){


        ModelAndView modelAndView =new ModelAndView("hello");
        modelAndView.addAllObjects(new HashMap<String, String>(){
            {
                this.put("name","Andy");
            }
        });
        return modelAndView;


    }
}
